﻿using System.ComponentModel.DataAnnotations;
using Microsoft.Web.Mvc;

namespace SportMeetingPlanner.Models
{
    public class User
    {
        [Key]
        [Required(ErrorMessage = "User name is required")]
        [RegularExpression("^[a-zA-Z0-9]+$", ErrorMessage = "User name should contain only letters and numbers")]
        public virtual string UserName { get; set; }
        [RegularExpression("^[a-zA-Z0-9]+$", ErrorMessage = "Last name should contain only letters and numbers")]
        public virtual string LastName { get; set; }
        [RegularExpression("^[a-zA-Z0-9]+$", ErrorMessage = "First name should contain only letters and numbers")]
        public virtual string FirstName { get; set; }
        public virtual bool IsAdmin { get; set; }
        [Required(ErrorMessage = "E-Mail is required")]
        [EmailAddress(ErrorMessage = "Invalid e-mail address")]
        public virtual string Email { get; set; }
        [Required(ErrorMessage = "Telephone number is required")]
        [RegularExpression("[0-9]+", ErrorMessage = "Telephone number should contain only numbers")]
        public virtual string TelephoneNumber { get; set; }
        [Required(ErrorMessage = "Password is required")]
        public virtual string Password { get; set; }
    }
}